import 'package:json_annotation/json_annotation.dart';
import 'user.dart';
part 'user_card.g.dart';

@JsonSerializable()
class UserCard {
  final User? user;
  final Detail? detail;
  final Privacy? privacy;
  @JsonKey(defaultValue: 0)
  final int followCount;
  @JsonKey(defaultValue: 0)
  final int fansCount;
  @JsonKey(defaultValue: 0)
  final int friendCount;
  @JsonKey(defaultValue: 0)
  final int giftSendCount;
  @JsonKey(defaultValue: 0)
  final int giftReceiveCount;
  @JsonKey(defaultValue: 0)
  final int visitCount;
  @JsonKey(defaultValue: 0)
  final int visitRedCount;
  @JsonKey(defaultValue: '')
  final String carAnimationType;
  @JsonKey(defaultValue: '')
  final String carAnimationUrl;
  @JsonKey(defaultValue: 0)
  final int webpHeight;
  @JsonKey(defaultValue: 0)
  final int webpWidth;
  @JsonKey(defaultValue: 0)
  final int webpMillis;
  @JsonKey(defaultValue: 0)
  final int showCar;
  @JsonKey(defaultValue: 0)
  final int showMall;
  @JsonKey(defaultValue: '')
  final String guildName;
  @JsonKey(defaultValue: '')
  final String guildLabelBgUrl;
  @JsonKey(defaultValue: 0)
  final int diamondBalance;
  @JsonKey(defaultValue: 0)
  final int coinBalance;
  @JsonKey(defaultValue: '')
  final String anchorAuthUrl;
  @JsonKey(defaultValue: '')
  final String guildApplyUrl;
  @JsonKey(defaultValue: false)
  final bool sayHi;
  @JsonKey(defaultValue: [])
  final List<dynamic> giftReceiveRankTop3Head;
  @JsonKey(defaultValue: [])
  final List<TagList> tagList;

  const UserCard({
    this.user,
    this.detail,
    this.privacy,
    required this.followCount,
    required this.fansCount,
    required this.friendCount,
    required this.giftSendCount,
    required this.giftReceiveCount,
    required this.visitCount,
    required this.visitRedCount,
    required this.carAnimationType,
    required this.carAnimationUrl,
    required this.webpHeight,
    required this.webpWidth,
    required this.webpMillis,
    required this.showCar,
    required this.showMall,
    required this.guildName,
    required this.guildLabelBgUrl,
    required this.diamondBalance,
    required this.coinBalance,
    required this.anchorAuthUrl,
    required this.guildApplyUrl,
    required this.sayHi,
    required this.giftReceiveRankTop3Head,
    required this.tagList,
  });

  factory UserCard.fromJson(Map<String, dynamic> json) =>
      _$UserCardFromJson(json);

  Map<String, dynamic> toJson() => _$UserCardToJson(this);
}




@JsonSerializable()
class Detail {
  @JsonKey(defaultValue: '')
  final String bio;
  @JsonKey(defaultValue: 0)
  final int age;
  @JsonKey(defaultValue: 0)
  final int height;
  @JsonKey(defaultValue: 0)
  final int weight;
  @JsonKey(defaultValue: '')
  final String vocation;
  @JsonKey(defaultValue: '')
  final String homeProvince;
  @JsonKey(defaultValue: '')
  final String homeCity;
  @JsonKey(defaultValue: '')
  final String location;
  @JsonKey(defaultValue: '')
  final String ipBelong;
  @JsonKey(defaultValue: '')
  final String constellation;
  @JsonKey(defaultValue: [])
  final List<String> photoList;
  @JsonKey(defaultValue: '')
  final String voiceUrl;
  @JsonKey(defaultValue: 0)
  final int voiceDuration;

  const Detail({
    required this.bio,
    required this.age,
    required this.height,
    required this.weight,
    required this.vocation,
    required this.homeProvince,
    required this.homeCity,
    required this.location,
    required this.ipBelong,
    required this.constellation,
    required this.photoList,
    required this.voiceUrl,
    required this.voiceDuration,
  });

  factory Detail.fromJson(Map<String, dynamic> json) =>
      _$DetailFromJson(json);

  Map<String, dynamic> toJson() => _$DetailToJson(this);
}

@JsonSerializable()
class Privacy {
  @JsonKey(defaultValue: 0)
  final int birthday;
  @JsonKey(defaultValue: false)
  final bool showLocation;
  @JsonKey(defaultValue: '')
  final String phoneAreaCode;
  @JsonKey(defaultValue: '')
  final String phone;
  @JsonKey(defaultValue: false)
  final bool bindPhone;
  @JsonKey(defaultValue: false)
  final bool youth;
  @JsonKey(defaultValue: 0)
  final int authStatus;
  @JsonKey(defaultValue: false)
  final bool showLive;
  @JsonKey(defaultValue: false)
  final bool showGuild;
  @JsonKey(defaultValue: 0)
  final int score;
  @JsonKey(defaultValue: 0)
  final int jewel;
  @JsonKey(defaultValue: false)
  final bool showFollow;
  @JsonKey(defaultValue: 0)
  final int showFollowType;
  @JsonKey(defaultValue: false)
  final bool friendAuth;
  @JsonKey(defaultValue: false)
  final bool greetSwitch;
  @JsonKey(defaultValue: 0)
  final int chatLevelLimit;
  @JsonKey(defaultValue: false)
  final bool heartbeatLine;
  @JsonKey(defaultValue: false)
  final bool unearthly;
  @JsonKey(defaultValue: false)
  final bool moduleHide;
  @JsonKey(defaultValue: false)
  final bool mysteryMan;
  @JsonKey(defaultValue: '')
  final String mysteryManVipLimit;
  @JsonKey(defaultValue: false)
  final bool closeFloatWindow;

  const Privacy({
    required this.birthday,
    required this.showLocation,
    required this.phoneAreaCode,
    required this.phone,
    required this.bindPhone,
    required this.youth,
    required this.authStatus,
    required this.showLive,
    required this.showGuild,
    required this.score,
    required this.jewel,
    required this.showFollow,
    required this.showFollowType,
    required this.friendAuth,
    required this.greetSwitch,
    required this.chatLevelLimit,
    required this.heartbeatLine,
    required this.unearthly,
    required this.moduleHide,
    required this.mysteryMan,
    required this.mysteryManVipLimit,
    required this.closeFloatWindow,
  });

  factory Privacy.fromJson(Map<String, dynamic> json) =>
      _$PrivacyFromJson(json);

  Map<String, dynamic> toJson() => _$PrivacyToJson(this);
}

@JsonSerializable()
class TagList {
  @JsonKey(defaultValue: 0)
  final int tagId;
  @JsonKey(defaultValue: '')
  final String tagName;
  @JsonKey(defaultValue: false)
  final bool selected;
  @JsonKey(defaultValue: '')
  final String bgColor;

  const TagList({
    required this.tagId,
    required this.tagName,
    required this.selected,
    required this.bgColor,
  });

  factory TagList.fromJson(Map<String, dynamic> json) =>
      _$TagListFromJson(json);

  Map<String, dynamic> toJson() => _$TagListToJson(this);
}
